//
//  CZDiscoverViewController.swift
//  GZWeibo666
//
//  Created by Apple on 16/04/22.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class CZDiscoverViewController: CZBaseTableViewController {
    let cellTitleArr =
    [["cellTitle":"热门微博","iconName":"hot_status"],
        ["cellTitle":"找人","iconName":"find_people"],
        ["cellTitle":"微博头条","iconName":"like"],
        ["cellTitle":"玩游戏","iconName":"game_center"],
        ["cellTitle":"周边","iconName":"near"],
        ["cellTitle":"随手拍","iconName":"video"],
        ["cellTitle":"股票","iconName":"card"],
        ["cellTitle":"电影","iconName":"movie"],
        ["cellTitle":"红人淘","iconName":"card"],
        ["cellTitle":"更多频道","iconName":"more"]
    ]
    
    override func viewDidLoad() {
        super.viewDidLoad()

    }
    
    // MARK: - tableview数据源方法
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return cellTitleArr.count
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
        let cell:UITableViewCell = UITableViewCell()
        cell.textLabel?.text =  cellTitleArr[indexPath.row]["cellTitle"]
        cell.imageView?.image = UIImage(named: cellTitleArr[indexPath.row]["iconName"]!)
        return cell
    }
    
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        print("'点击选中了cell")
        
        let cell:UITableViewCell = tableView.cellForRowAtIndexPath(indexPath)!
        
        let testVc = CZTestViewController()
        testVc.title = cell.textLabel?.text
        navigationController?.pushViewController(testVc, animated: true)
        
        
    }
}
